﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="接箍车丝生产统计表.aspx.cs" Inherits="syc.ZhiJian.Report.接箍车丝生产统计表" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title></title>
</head>
    <script type="text/javascript" language="javascript" src="/common.js"></script>
<body>
    <form id="form1" runat="server">
       <div class="hooo">
        <div id="wintop" class="wintop"><span lang="zh-cn"><u>接箍车丝生产统计表</u></span></div>
        <asp:Panel ID="Panel1" runat="server" CssClass="panel" Height="46px">
  
        <table>
        <tr id="row2" runat="server">
        <td>起始日期：</td>    
        <td>    
        <asp:TextBox ID="Date1" runat="server"  Width="100px" AutoPostBack="true"></asp:TextBox>
        <img alt="" src="/Icons/29.png" align="middle" onclick="makecalendar(document.getElementById('Date1').value, document.getElementById('Date1'));" />
        </td>        
        <td>截止日期：</td>
        <td>
        <asp:TextBox ID="Date2" runat="server" Width="100px" AutoPostBack="true"></asp:TextBox>
        <img alt="" src="/Icons/29.png" align="middle" onclick="makecalendar(document.getElementById('Date2').value, document.getElementById('Date2'));" />
        </td>
        <td>
        <input type="button" class="smallbutton" id="clear" value="清空日期"/>
        </td>
       </tr>
       <tr>
        <td>产品：</td>
        <td>
        <asp:DropDownList ID="DList_Produce" runat="server" AutoPostBack="True">
            <asp:ListItem Value="0">全部</asp:ListItem>
            <asp:ListItem Value="1">油管(J55)</asp:ListItem>
            <asp:ListItem Value="2">套管(J55)</asp:ListItem>
            <asp:ListItem Value="3">油管(N80Q)</asp:ListItem>
            <asp:ListItem Value="4">套管(N80Q)</asp:ListItem>            
            
        </asp:DropDownList>
        </td>
        <td>工段:</td>
        <td>
            <asp:DropDownList ID="DL_GongDuan" runat="server" AutoPostBack="True">
            <asp:ListItem Value="0">全部</asp:ListItem>
            <asp:ListItem Value="1">甲</asp:ListItem>
            <asp:ListItem Value="2">乙</asp:ListItem>
            <asp:ListItem Value="3">丙</asp:ListItem>
            <asp:ListItem Value="4">丁</asp:ListItem>
        </asp:DropDownList>
        </td>
        <td><asp:Button ID="Export" runat="server" CssClass="button" Text="导出"/></td>
        </tr>
        </table>

        </asp:Panel>
        <asp:Panel ID="Panel2" runat="server" CssClass="panel2">
        <asp:Label ID="Message" runat="server" Text="·准备就绪" CssClass="prompt" Visible="True"></asp:Label>
        </asp:Panel> 

    <div align="center" id="report" style="margin-top:20px">
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
            DataSourceID="SqlDataSource1"
            style="text-align: center" BorderColor="Black" 
                BorderStyle="Solid" BorderWidth="2px" GridLines="Both" CellPadding="0" CellSpacing="1" >
            <RowStyle Height="40px" BorderColor="Black" BorderStyle="Solid" BorderWidth="1px" />
            <HeaderStyle Height="40px" />
            <Columns>
                <asp:BoundField DataField="日期" DataFormatString="{0:d}" HeaderText="日期" 
                    SortExpression="日期" />
                <asp:BoundField DataField="产品类别" HeaderText="产品类别" 
                    SortExpression="产品类别" />
                <asp:BoundField DataField="工段" HeaderText="工段" SortExpression="工段" />
                <asp:BoundField DataField="粗车合格" HeaderText="粗车合格" SortExpression="粗车合格" />
                <asp:BoundField DataField="磁粉碳伤合格" HeaderText="磁粉碳伤合格" 
                    SortExpression="磁粉碳伤合格" />
                <asp:BoundField DataField="磁粉碳伤不合格" HeaderText="磁粉碳伤不合格" 
                    SortExpression="磁粉碳伤不合格" />
            </Columns>
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:SCMConnectionString1 %>" SelectCommand="SELECT [日期]
      ,
(case
when 产品类别ID=1 then '油管(J55)'
when 产品类别ID=2 then '套管(J55)'
when 产品类别ID=3 then '油管(N80)'
when 产品类别ID=4 then '套管(N80)'
end) AS 产品类别
      ,
(case
when [工段]=1 then '甲'
when [工段]=2 then '乙'
when [工段]=3 then '丙'
when [工段]=4 then '丁'
end) AS 工段
      ,[粗车合格]
      ,[粗车不合格]
      ,[磁粉碳伤合格]
      ,[磁粉碳伤不合格]
  FROM [生产进度3]
  WHERE (产品类别ID=@产品 OR 0=@产品) AND (工段=@工段 OR 0=@工段)
        AND 日期 BETWEEN @起始日期 AND @截止日期">
  <SelectParameters>
    <asp:ControlParameter DbType="Int32" ControlID="DList_Produce" PropertyName="SelectedValue" 
    Name="产品" DefaultValue="1" />
    <asp:ControlParameter DbType="String" ControlID="DL_GongDuan" PropertyName="SelectedValue" 
    Name="工段" />
   <asp:ControlParameter DbType="Date" ControlID="Date1" PropertyName="Text" 
    Name="起始日期" DefaultValue="2010-1-1" />
   <asp:ControlParameter DbType="Date" ControlID="Date2" PropertyName="Text" 
    Name="截止日期" DefaultValue="2010-1-30" />
  </SelectParameters>
  </asp:SqlDataSource>
    </div>
    </form>
</body>
</html>
